/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package brain;

import java.sql.SQLException;
import java.util.Map;

/**
 * handle connection and parsing of result
 * @author martin
 */
public interface ForeignConnection {
  /**
   * connect to server
   * @throws SQLException 
   */
  public void connect() throws SQLException;
  /**
   * shutdown connection to server
   * @throws SQLException 
   */
  public void disconnect() throws SQLException;
  /**
   * verify if connected to server
   * @return 
   */
  public boolean isConnected();
  
  /**
   * execute query but dont expect anything in return
   * @param req as String
   * @throws SQLException 
   */
  public void exec(final String req) throws SQLException;

  /**
   * execute query and wait for result
   * @param req as String
   * @return Map containing reply
   * @throws SQLException 
   */
  public Map query(final String req) throws SQLException;
  
}
